@REM 指定编码为utf-8
chcp 65001

@REM V0.0.1-2022-12-22
@REM 清空build文件夹
del build\*.* /q

@REM 复制7z
xcopy /y 7z build\CoolorusForAdobeAI\7z\

@REM 复制必要文件
xcopy /y CSXS\ build\CoolorusForAdobeAI\CoolorusForAdobeAI\CSXS\
xcopy /e/c/y assets\ build\CoolorusForAdobeAI\CoolorusForAdobeAI\assets\
xcopy /e/c/y css\ build\CoolorusForAdobeAI\CoolorusForAdobeAI\css\
xcopy /e/c/y font\ build\CoolorusForAdobeAI\CoolorusForAdobeAI\font\
xcopy /e/c/y js\ build\CoolorusForAdobeAI\CoolorusForAdobeAI\js\
xcopy /e/c/y jsx\ build\CoolorusForAdobeAI\CoolorusForAdobeAI\jsx\
xcopy /e/c/y locale\ build\CoolorusForAdobeAI\CoolorusForAdobeAI\locale\
xcopy /e/c/y META-INF\ build\CoolorusForAdobeAI\CoolorusForAdobeAI\META-INF\
xcopy /e/c/y node_modules\ build\CoolorusForAdobeAI\CoolorusForAdobeAI\node_modules\

copy /y index.html build\CoolorusForAdobeAI\CoolorusForAdobeAI\index.html
copy /y update.log build\CoolorusForAdobeAI\CoolorusForAdobeAI\update.log
copy /y 安装.bat build\CoolorusForAdobeAI\安装.bat

@REM 压缩插件本体
"7z\7z.exe" a -t7z -r build\CoolorusForAdobeAI\CoolorusForAdobeAI.7z .\build\CoolorusForAdobeAI\CoolorusForAdobeAI\* -xr!7z -xr!*.7z

@REM @REM 删除未压缩的插件文件夹
rmdir /s/q build\CoolorusForAdobeAI\CoolorusForAdobeAI

@REM @REM @REM 打包整体
"7z\7z.exe" a -t7z -r build\CoolorusForAdobeAI.7z .\build\*

@REM @REM @REM 清理build文件夹
rmdir /s/q build\CoolorusForAdobeAI

@REM @REM @REM 解压安装包
"7z\7z.exe" x build\CoolorusForAdobeAI.7z -aoa -obuild

@REM @REM @REM 调用安装脚本
call build\CoolorusForAdobeAI\安装.bat
